package com.usian.controller;

import com.usian.pojo.SearchItem;
import com.usian.service.SearchItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SearchItemController {
    @Autowired
    private SearchItemService searchItemService;

    @RequestMapping("importAll")
    public void importAll() {
        searchItemService.importAll();
    }

    ;

    @RequestMapping("list")
    public List<SearchItem> selectByQ(@RequestParam String q,@RequestParam Integer page,@RequestParam Integer pagesize) {
        return searchItemService.selectByQ(q,page,pagesize);
    }

    ;

}
